﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T4Console
{
    /// <summary>
    /// 生成模版信息
    /// </summary>
    public class GenerateTemplate
    {
        public GenerateTemplate(string className, string classXmlDocsSummary, List<GenerateTemplateField> generateTemplateFieldList)
        {
            ClassName = className;
            ClassXmlDocsSummary = classXmlDocsSummary;
            GenerateTemplateFieldList = generateTemplateFieldList;
        }

        public GenerateTemplate()
        {
            GenerateTemplateFieldList = new List<GenerateTemplateField>();
        }

        /// <summary>
        /// 类名称
        /// </summary>
        public string ClassName { get; set; }

        /// <summary>
        /// 类文档注释
        /// </summary>
        public string ClassXmlDocsSummary { get; set; }

        /// <summary>
        /// 首字母小写类名称
        /// </summary>
        public string InitialLowercaseClassName => ClassName.Substring(0, 1).ToLower() + ClassName.Substring(1);

        /// <summary>
        /// 生成模版字段集合
        /// </summary>
        public List<GenerateTemplateField> GenerateTemplateFieldList { get; set; }

    }

    /// <summary>
    /// 生成模版字段信息
    /// </summary>
    public class GenerateTemplateField
    {
        public GenerateTemplateField(string fieldName, string fieldTypeName, string fieldXmlDocsSummary,string hasColumnTypeName)
        {
            FieldName = fieldName;
            FieldTypeName = fieldTypeName;
            FieldXmlDocsSummary = fieldXmlDocsSummary;
            HasColumnTypeName = hasColumnTypeName;
        }

        /// <summary>
        /// 字段名称
        /// </summary>
        public string FieldName { get; set; }

        /// <summary>
        /// 字段文档注释
        /// </summary>
        public string FieldXmlDocsSummary { get; set; }

        /// <summary>
        /// 字段类型名称
        /// </summary>
        public string FieldTypeName { get; set; }

        /// <summary>
        /// EF CORE Fluent API字段类型名称
        /// </summary>
        public string HasColumnTypeName { get; set; }

    }

}
